//请求品牌页面数据
//引入接口加上type关键字
import type {TrademarkListDataModel, TrademarkModel} from "./model/trademark"
//引入发送请求数据的函数
import request from '@/utils/request'
//枚举接口
enum Api{
    // 获取品牌列表数据
    getAllTrademarkListApi = '/admin/product/baseTrademark',
    //添加品牌
    saveTrademarkApi = '/admin/product/baseTrademark/save',
    //删除品牌
    deleteTrademarkApi = '/admin/product/baseTrademark/remove',
    //修改品牌
    updateTrademarkApi = '/admin/product/baseTrademark/update'
}
//获取品牌数据列表
export const getTrademarkList = (page:number,limit:number)=>{
    return request.get<any,TrademarkListDataModel>('/admin/product/baseTrademark/'+page+'/'+limit)
}
//2.增加 品牌数据
export const saveTrademarkList = (trademarkInfo:TrademarkModel)=>{
    return request.post<any,null>(`${Api.saveTrademarkApi}`,trademarkInfo)
}
//3.删除品牌数据 根据id删除
export const deleteTrademarkList = (id:number)=>{
    return request.delete<any,null>(`${Api.deleteTrademarkApi}/${id}`)
}
//4.更新/修改 品牌数据
export const updateTrademarkList = (trademarkInfo:TrademarkModel)=>{
    return request.put<any,null>(Api.updateTrademarkApi,trademarkInfo)
}

